From 9faaa5e8be929393edbd27d8ac38e228b3af43b8 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 22 Jun 2020 12:46:12 -0400 Subject: [PATCH] Fix change notification for event controllers We were adding event controllers at the end, but announcing a change at the beginning, in gtk_widget_add_controller. Fix that by emitting ::items-changed for the position where we actually inserted the controller. --- gtk/gtkwidget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 55127a2ed7..2cedb2508f 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -11412,7 +11412,7 @@ gtk_widget_add_controller (GtkWidget *widget, g_ptr_array_add (priv->controllers, controller); if (priv->controller_observer) - gtk_list_list_model_item_added_at (priv->controller_observer, 0); + gtk_list_list_model_item_added_at (priv->controller_observer, priv->controllers->len - 1); } /** -- 2.30.2